package club.justwill.single.persistence.document;

import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;
import org.springframework.data.mongodb.core.mapping.Field;

/**
 * Created by xiangnan on 16-1-14.
 */
@Document(collection = "address")
public class UserAddress extends MongoDocument {

    @Field("user_id")
    @Indexed(name = "address_user_id")
    private Long userId;

    @Field("province")
    private String province;

    @Field("city")
    private String city;

    @Field("address")
    private String address;

    @Field("name")
    private String name;

    @Field("phone")
    private String phoneNumber;

    @Field("zip_code")
    private String zipCode;

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        if(userId == null) {
            this.userId = 0L;
        } else {
            this.userId = userId;
        }
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public String getZipCode() {
        return zipCode;
    }

    public void setZipCode(String zipCode) {
        this.zipCode = zipCode;
    }
}
